{{ extend './_layouts/home.html' }}

{{ block 'title' }}Update Page{{ /block }}

{{ block 'body' }}
  <div class="container-fluid">
    <div class="row">
      <nav class="col-md-2 d-none d-md-block bg-light sidebar">
        <div class="sidebar-sticky">
          <ul class="nav flex-column">
            <li class="nav-item">
              <a class="nav-link" href="/">
                <span data-feather="home"></span>
                Dashboard
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link" href="/new">
                <span data-feather="file"></span>
                Insert Student
              </a>
            </li>
            <li class="nav-item">
              <a class="nav-link active" href="#">
                <span data-feather="file"></span>
                Update Student
              </a>
            </li>
          </ul>
        </div>
      </nav>

      <main role="main" class="col-md-9 ml-sm-auto col-lg-10 px-4">
        <h2 style='margin-top:30px'>Update Student Page</h2>
        <form action="/update" method="post">
          <input type="hidden" name="id" value="{{ student.id }}" />
          <div class="form-group" style='margin-top:30px'>
            <label for="input_name">Name</label>
            <input type="text" class="form-control" id="input_name" name="name" placeholder="input name" value="{{ student.name }}">
          </div>
          <div class="form-group">
            <label>Gender</label>
            <div style="margin-left:50px">
              <div class="form-check form-check-inline">
                {{ if student.gender == 1 }}
                <input class="form-check-input" type="radio" name="gender" id="inlineRadio1" value="1" checked>
                {{ else if student.gender == 0 }}
                <input class="form-check-input" type="radio" name="gender" id="inlineRadio1" value="1">
                {{ /if }}
                <label class="form-check-label" for="inlineRadio1">Male</label>
              </div>
              <div class="form-check form-check-inline">
                {{ if student.gender == 0 }}
                <input class="form-check-input" type="radio" name="gender" id="inlineRadio2" value="0" checked>
                {{ else if student.gender == 1 }}
                <input class="form-check-input" type="radio" name="gender" id="inlineRadio2" value="0">
                {{ /if }}
                <label class="form-check-label" for="inlineRadio2">Female</label>
              </div>
            </div>
          </div>
          <div class="form-group">
            <label for="input_age">Age</label>
            <input type="number" class="form-control" id="input_age" name="age" placeholder="input age" value="{{ student.age }}">
          </div>
          <div class="form-group">
            <label for="input_score">Score</label>
            <input type="number" class="form-control" id="input_score" name="score" placeholder="input score" value="{{ student.score }}">
          </div>
          <button type="submit" class="btn btn-primary">Submit</button>
        </form>
      </main>
    </div>
  </div>
{{ /block }}
